#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn  =2e2+5;
struct node{
    ll x,y,sets,c;
    node(){x=0;y=0;sets=0;c=0;}
}a[maxn];

vector<int>edge[maxn];
bool visit[maxn];

ll squa(ll aa,ll b){
    return aa*aa+b*b;
}

int n,m,v,u,k,s;
ll r;
queue<int>q;
int bfs(){
    q.push(1);
    a[1].sets=0;
    a[1].c=0;
    visit[1]=true;
    while(!q.empty()){
        v = q.front();q.pop();
        if(v==2){
            printf("%d\n",a[v].c-1);
            return 0;
        }
        s = edge[v].size();
        ll sets = a[v].sets;
        for(int i=0;i<s;++i){
            u = edge[v][i];
            if(u>n)sets++;
            if(!visit[u]&&sets<=k){
                a[u].sets=sets;
                a[u].c=a[v].c+1;
                visit[u]=true;
                q.push(u);
            }
        }
    }
}

int main(){
    scanf("%d%d%d%lld",&n,&m,&k,&r);
    s=n+m;
    for(int i=1;i<=s;++i)scanf("%lld%lld",&a[i].x,&a[i].y);
    for(int i=1;i<s;++i){
        for(int j=i+1;j<=s;++j){
            if(squa(a[i].x-a[j].x,a[i].y-a[j].y)<=r*r)edge[i].push_back(j),edge[j].push_back(i);
        }
    }
    bfs();
    for(int i=1;i<=s;++i){
        printf("%d: ",i);
        for(int j=0;j<edge[i].size();j++)printf("%d ",edge[i][j]);
        printf("\n");
    }
}
